1 Public Class FrmPhysicalCount
2
3 Private Sub FrmPhysicalCount_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
4 'FILLComboBox("SELECT Catg_ID, Catg_Name FROM TBL_Category_File", cbclass)
5 refresh_list()
6 Audit_Trail(xUser_ID, TimeOfDay, "View Physical Counting" )
7
8 End Sub
9
10 Private Sub FrmPhysicalCount_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
11 With Me
12 GroupBox1.Width = (.Width - (MDIMain.TSHoldRight.Width / 2)) + 60
13 GroupBox1.Height = .Height - (MDIMain.TSHoldAdvisory.Height + 45)
14 .lstphysical.Width = GroupBox1.Width - 10
15 .lstphysical.Height = GroupBox1.Height - 18
16 cbclass.Left = (GroupBox1.Left + GroupBox1.Width) - (.cbclass.Width) - 4
17 .Label3.Left = (.cbclass.Left - .Label3.Width) - 2
18 '.RBALL.Left = (GroupBox1.Left + GroupBox1.Width) - (.RBALL.Width)
19 '.rbcatitemlist.Left = (.RBALL.Left - .rbcatitemlist.Width) - 2
20 '.RBCat.Left = (.rbcatitemlist.Left - .RBCat.Width) - 2
21 End With
22 End Sub
23
24 Private Sub cbclass_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbclass.SelectedIndexChanged
25 'FillListView(ExecuteSQLQuery("SELECT Item_ID as 'Item ID', Item_Name as 'Item Name', Item_Description as 'Description', Item_Barcode as 'Barcode', Item_Reorder_Point as 'Reorder Point', Unit_Measure as 'Measure', Item_Price as 'Price' FROM TBL_Stocks_Balances WHERE Catg_ID =" & Split(cbclass.Text, " - ")(0) & " ORDER BY Item_Name"), lstphysical, 0)
26 'MsgBox(Split(cbclass.Text, " - ")(0))
27
28 For i = 0 To lstphysical.Items.Count - 1
29 If Int(lstphysical.Items(i).SubItems(5).Text) <= 0 Then
30 lstphysical.Items(i).ForeColor = Color.Brown
31 Else
32 lstphysical.Items(i).ForeColor = Color.Black
33 End If
34 Next
35
36 End Sub
37
38 Private Sub dtfrom_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtfrom.ValueChanged
39 refresh_list()
40 End Sub
41
42 Private Sub refresh_list()
43 ' sqlSTR = "SELECT TBL_category_item_file.item_id AS 'ID', TBL_Category_Item_File.Item_name as 'Name', TBL_Category_Item_File.Item_Description as 'Description', TBL_Category_Item_File.Item_Barcode AS 'Barcode', TBL_Category_Item_File.Item_Reorder_Point AS 'Reorder Point', TBL_Stocks_Balances.Item_QTY as 'Quantity' " & _
44 ' "FROM TBL_category_item_file INNER JOIN TBL_Stocks_Balances ON TBL_Category_Item_File.Item_ID = TBL_Stocks_Balances.Item_ID " & _
45 ' "WHERE Catg_ID =" & Split(cbclass.Text, " - ")(0) & "ORDER BY TBL_Category_Item_File.Item_name"
46 ' FillListView(ExecuteSQLQuery(sqlSTR), lstphysical, 0)
47
48 sqlSTR = "SELECT P_ID AS 'P_ID', P_Date as 'DATE', Lastname + ', ' + Firstname + ' ' + Middlename AS ' Username' " & _
49 "FROM TBL_Physical_Count " & _
50 "INNER JOIN TBL_Users ON TBL_Physical_Count.User_ID = TBL_Users.User_ID " & _
51 " WHERE P_Date >='" & Format(dtfrom.Value, "MM/dd/yyyy") & "' AND P_Date <='" & Format(dtto.Value, "MM/dd/yyyy") & "'"
52 FillListView(ExecuteSQLQuery(sqlSTR), lstphysical, 0)
53 End Sub
54
55 Private Sub dtto_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtto.ValueChanged
56 refresh_list()
57 End Sub
58 End Class